﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminPage/Admin.master" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="SBRUSYS_AdminPage_Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 27px;
        }
        .style3
        {
            height: 20px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style1">
        <tr>
            <td class="style2">
                账号管理</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" DataKeyNames="account" 
                    DataSourceID="SqlDataSource1Admin" AllowSorting="True">
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                        <asp:BoundField DataField="IDcard" HeaderText="IDcard" 
                            SortExpression="IDcard" />
                        <asp:BoundField DataField="account" HeaderText="账号" ReadOnly="True" 
                            SortExpression="account" />
                        <asp:BoundField DataField="acpassword" HeaderText="密码" 
                            SortExpression="acpassword" />
                        <asp:BoundField DataField="mlevel" HeaderText="mlevel" 
                            SortExpression="mlevel" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1Admin" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnString %>" 
                    SelectCommand="SELECT * FROM [AdminTable]" 
                    ConflictDetection="CompareAllValues" 
                    DeleteCommand="DELETE FROM [AdminTable] WHERE [IDcard] = @original_IDcard AND [account] = @original_account AND [acpassword] = @original_acpassword AND (([mlevel] = @original_mlevel) OR ([mlevel] IS NULL AND @original_mlevel IS NULL))" 
                    InsertCommand="INSERT INTO [AdminTable] ([IDcard], [account], [acpassword], [mlevel]) VALUES (@IDcard, @account, @acpassword, @mlevel)" 
                    OldValuesParameterFormatString="original_{0}" 
                    UpdateCommand="UPDATE [AdminTable] SET [account] = @account, [acpassword] = @acpassword, [mlevel] = @mlevel WHERE [IDcard] = @original_IDcard AND [account] = @original_account AND [acpassword] = @original_acpassword AND (([mlevel] = @original_mlevel) OR ([mlevel] IS NULL AND @original_mlevel IS NULL))">
                    <DeleteParameters>
                        <asp:Parameter Name="original_IDcard" Type="String" />
                        <asp:Parameter Name="original_account" Type="String" />
                        <asp:Parameter Name="original_acpassword" Type="String" />
                        <asp:Parameter Name="original_mlevel" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="IDcard" Type="String" />
                        <asp:Parameter Name="account" Type="String" />
                        <asp:Parameter Name="acpassword" Type="String" />
                        <asp:Parameter Name="mlevel" Type="Int32" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="account" Type="String" />
                        <asp:Parameter Name="acpassword" Type="String" />
                        <asp:Parameter Name="mlevel" Type="Int32" />
                        <asp:Parameter Name="original_IDcard" Type="String" />
                        <asp:Parameter Name="original_account" Type="String" />
                        <asp:Parameter Name="original_acpassword" Type="String" />
                        <asp:Parameter Name="original_mlevel" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

